gtksettings: Add a debug message if there is no default GtkSettings
authorPhilip Withnall <withnall@endlessm.com>
Thu, 9 Feb 2017 17:17:05 +0000 (17:17 +0000)
committerPhilip Withnall <withnall@endlessm.com>
Tue, 12 Sep 2017 15:04:44 +0000 (16:04 +0100)
Make it slightly more obvious when things are about to slide sideways
because a NULL GtkSettings has been returned to a caller. This is a
valid return value, but is rarely handled correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=778382

gtk/gtksettings.c

index ee0a081993ae39b4bb6e015bc80a4a50c0170076..3bdb863eaf39cec0789fafeeed3ea96a8b2c92ab 100644 (file)
@@ -1281,8 +1281,10 @@ gtk_settings_get_default (void)
 
   if (display)
     return gtk_settings_get_for_display (display);
-  else
-    return NULL;
+
+  g_debug ("%s() returning NULL GtkSettings object. Is a display available?",
+           G_STRFUNC);
+  return NULL;
 }
 
 static void